package componentes;

import java.io.IOException;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;

public class StrategyMapTagRenderer extends Renderer {
	
	public void encodeBegin(FacesContext context, UIComponent component)throws IOException{
		UIStrategyMap strategyMap = (UIStrategyMap) component;		
		ResponseWriter w = context.getResponseWriter();
		
		w.write("<br>");
		w.startElement("table", component);
		
		//for(String str:strategyMap.getPerspectives()){
			String str = strategyMap.getPerspectives();
			w.startElement("tr", component);
			
			w.startElement("td", component);
			w.write(str);
			w.endElement("td");
			w.startElement("td", component);
			w.endElement("td");
			
			w.endElement("tr");
		//}
		
		w.endElement("table");
		w.flush();
	}
}
